package com.woniuxy01;

/**
 * @author 作者
 * @create 2025-07-28 9:47
 */
public class Test01 {
    public static void main(String[] args) {
        System.out.println("abcdABc".compareTo("abcdabc"));
        System.out.println("abcdABc".compareToIgnoreCase("abcdabc"));
    }

    private static void test03() {
        String str="abxyzcdxyzefgyza";
        System.out.println(str.replace('a', 'm'));
        System.out.println(str.replace("xyz", "hjk"));
        str="         abcefg         ";
        System.out.println(str.length());
        System.out.println(str);
        str=str.trim();
        System.out.println(str.length());
        System.out.println(str);
    }

    private static void test02() {
        String str="aA23bBc13efXY";
        char[] chars = str.toCharArray();
        int num=0,big=0,small=0;
        for(int i=0;i<chars.length;i++){
            if(Character.isLowerCase(chars[i])){
                small++;
            }
            if(Character.isUpperCase(chars[i])){
                big++;
            }
            if(chars[i]>='0' && chars[i]<='9'){
                num++;
            }
        }
        System.out.println("num="+num+",big="+big+",small="+small);
    }

    private static void test01() {
        String str="abc";
        char[] chars = str.toCharArray();
        chars=new char[]{'c','b','a'};
        str=new String(chars);
        System.out.println(str);
    }
}
